<?php

/**
 * This is the model class for table "jumlahindustripersektor".
 *
 * The followings are the available columns in table 'jumlahindustripersektor':
 * @property integer $jips_id
 * @property integer $jips_kec
 * @property integer $jips_jumlah
 * @property integer $jips_31
 * @property integer $jips_32
 * @property integer $jips_33
 * @property integer $jips_34
 * @property integer $jips_35
 * @property integer $jips_36
 * @property integer $jips_37
 * @property integer $jips_38
 * @property integer $jips_39
 * @property integer $jips_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $jipsKec
 */
class Jumlahindustripersektor extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahindustripersektor the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahindustripersektor';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jips_kec, jips_jumlah, jips_31, jips_32, jips_33, jips_34, jips_35, jips_36, jips_37, jips_38, jips_39, jips_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jips_id, jips_kec, jips_jumlah, jips_31, jips_32, jips_33, jips_34, jips_35, jips_36, jips_37, jips_38, jips_39, jips_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'jipsKec' => array(self::BELONGS_TO, 'Kecamatan', 'jips_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jips_id' => 'Jips',
			'jips_kec' => 'Kecamatan',
			'jips_jumlah' => 'Jumlah Perusahaan',
			'jips_31' => '31',
			'jips_32' => '32',
			'jips_33' => '33',
			'jips_34' => '34',
			'jips_35' => '35',
			'jips_36' => '36',
			'jips_37' => '37',
			'jips_38' => '38',
			'jips_39' => '39',
			'jips_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jips_id',$this->jips_id);
		$criteria->compare('jips_kec',$this->jips_kec);
		$criteria->compare('jips_jumlah',$this->jips_jumlah);
		$criteria->compare('jips_31',$this->jips_31);
		$criteria->compare('jips_32',$this->jips_32);
		$criteria->compare('jips_33',$this->jips_33);
		$criteria->compare('jips_34',$this->jips_34);
		$criteria->compare('jips_35',$this->jips_35);
		$criteria->compare('jips_36',$this->jips_36);
		$criteria->compare('jips_37',$this->jips_37);
		$criteria->compare('jips_38',$this->jips_38);
		$criteria->compare('jips_39',$this->jips_39);
		$criteria->compare('jips_tahun',$this->jips_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}